package com.example.videoworks.controller;


import com.example.videoworks.entity.User;
import com.example.videoworks.mapper.UserMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author Lily
 * @since 2023-05-11
 */
@RestController
public class UserController {

    @Autowired
    private UserMapper userMapper;

    @PostMapping("/user/add")
    public String addUser(User user){
        int addN = userMapper.insert(user);
        if(addN > 0)return "添加成功";
        else return "添加失败";
    }

}
